package com.cjx.interfaceinfo.controller;

import cn.hutool.json.JSONUtil;
import com.cjx.starsapisdk.model.params.NameParams;
import com.cjx.starsapisdk.model.response.NameResponse;
import org.springframework.web.bind.annotation.*;

/**
 * @author cjx
 * @description 测试用户接口调用控制器
 * @createDate 2024/5/5 11:19
 **/
@RestController()
@RequestMapping("/")
public class TestController {

    @GetMapping("/name")
    public String getNameGet(NameParams nameParams) {
//        NameResponse bean = JSONUtil.toBean(), NameResponse.class);
//        System.out.println(bean);
        String jsonStr = JSONUtil.toJsonStr(nameParams);
        System.out.println(jsonStr);
        return  jsonStr;
    }


    @PostMapping("/name")
    public String getNamePost(@RequestBody String name) {
        return "你的名字是：" + name;
    }

}
